<style>
    .xxpayPopupDiv .layui-form-label {
        width:15% !important;
        margin-left:1%;
    }
    .xxpayPopupDiv .layui-input-inline {
        width: 33% !important;
        margin-top: 0px;
    }
</style>
<div class="layui-fluid">
  <div class="layui-card">
    <div class="layui-tab layui-tab-brief">
      <div class="layui-tab-content">
          <form class="layui-form layui-form-pane" action="">
              <div class="layui-form-item">
                  <label class="layui-form-label">代付订单号</label>
                  <div class="layui-input-inline">
                      <input type="text" id="agentpayOrderId" disabled="disabled" class="layui-input">
                  </div>
                  <label class="layui-form-label">商户单号</label>
                  <div class="layui-input-inline">
                      <input type="text" id="mchOrderNo" disabled="disabled" class="layui-input">
                  </div>
              </div>
              <div class="layui-form-item">
                  <label class="layui-form-label">代付批次号</label>
                  <div class="layui-input-inline">
                      <input type="text" id="batchNo" disabled="disabled" class="layui-input">
                  </div>
                  <label class="layui-form-label">商户ID</label>
                  <div class="layui-input-inline">
                      <input type="text" id="mchId" disabled="disabled" class="layui-input">
                  </div>
              </div>
              <div class="layui-form-item">
                  <label class="layui-form-label">代付金额(元)</label>
                  <div class="layui-input-inline">
                      <input type="text" id="amount" disabled="disabled" class="layui-input">
                  </div>
                  <label class="layui-form-label">代付手续费(元)</label>
                  <div class="layui-input-inline">
                      <input type="text" id="fee" disabled="disabled" class="layui-input">
                  </div>
              </div>
              <div class="layui-form-item">
                  <label class="layui-form-label">打款金额(元)</label>
                  <div class="layui-input-inline">
                      <input type="text" id="remitAmount" disabled="disabled" class="layui-input">
                  </div>
                  <label class="layui-form-label">扣减金额(元)</label>
                  <div class="layui-input-inline">
                      <input type="text" id="subAmount" disabled="disabled" class="layui-input">
                  </div>
              </div>
              <div class="layui-form-item">
                  <label class="layui-form-label">扣减资金来源</label>
                  <div class="layui-input-inline">
                      <input type="text" id="subAmountFrom" disabled="disabled" class="layui-input">
                  </div>
                  <label class="layui-form-label">账户属性</label>
                  <div class="layui-input-inline">
                      <input type="text" id="accountAttr" disabled="disabled" class="layui-input">
                  </div>
              </div>
              <div class="layui-form-item">
                  <label class="layui-form-label">账户名</label>
                  <div class="layui-input-inline">
                      <input type="text" id="accountName" disabled="disabled" class="layui-input">
                  </div>
                  <label class="layui-form-label">账户号(银行卡号)</label>
                  <div class="layui-input-inline">
                      <input type="text" id="accountNo" disabled="disabled" class="layui-input">
                  </div>
              </div>
              <div class="layui-form-item">
                  <label class="layui-form-label">转账订单号</label>
                  <div class="layui-input-inline">
                      <input type="text" id="transOrderId" disabled="disabled" class="layui-input">
                  </div>
                  <label class="layui-form-label">状态</label>
                  <div class="layui-input-inline">
                      <input type="text" id="status" disabled="disabled" class="layui-input">
                  </div>
              </div>
              <div class="layui-form-item">
                  <label class="layui-form-label">开户行所在省</label>
                  <div class="layui-input-inline">
                      <input type="text" id="province" disabled="disabled" class="layui-input">
                  </div>
                  <label class="layui-form-label">开户行所在市</label>
                  <div class="layui-input-inline">
                      <input type="text" id="city" disabled="disabled" class="layui-input">
                  </div>
              </div>
              <div class="layui-form-item">
                  <label class="layui-form-label">开户行名称</label>
                  <div class="layui-input-inline">
                      <input type="text" id="bankName" disabled="disabled" class="layui-input">
                  </div>
                  <label class="layui-form-label">开户网点名称</label>
                  <div class="layui-input-inline">
                      <input type="text" id="bankNetName" disabled="disabled" class="layui-input">
                  </div>
              </div>
              <div class="layui-form-item">
                  <label class="layui-form-label">联行号</label>
                  <div class="layui-input-inline">
                      <input type="text" id="bankNumber" disabled="disabled" class="layui-input">
                  </div>
                  <label class="layui-form-label">银行代码</label>
                  <div class="layui-input-inline">
                      <input type="text" id="bankCode" disabled="disabled" class="layui-input">
                  </div>
              </div>
              <div class="layui-form-item">
                  <label class="layui-form-label">客户端IP</label>
                  <div class="layui-input-inline">
                      <input type="text" id="clientIp" disabled="disabled" class="layui-input">
                  </div>
                  <label class="layui-form-label">设备</label>
                  <div class="layui-input-inline">
                      <input type="text" id="device" disabled="disabled" class="layui-input">
                  </div>
              </div>
              <div class="layui-form-item">
                  <label class="layui-form-label">商户二次确认地址</label>
                  <div class="layui-input-inline">
                      <textarea type="text" style="height: 50px" id="mchConfirmReqUrl" disabled="disabled" class="layui-input"></textarea>
                  </div>
                  <label class="layui-form-label">商户二次确认响应数据</label>
                  <div class="layui-input-inline">
                      <textarea type="text" style="height: 50px" id="mchConfirmResp" disabled="disabled" class="layui-input"></textarea>
                  </div>
              </div>
              <div class="layui-form-item">
                  <label class="layui-form-label">通知地址</label>
                  <div class="layui-input-inline">
                      <input type="text" id="notifyUrl" disabled="disabled" class="layui-input">
                  </div>
                  <label class="layui-form-label">备注</label>
                  <div class="layui-input-inline">
                      <input type="text" id="remark" disabled="disabled" class="layui-input">
                  </div>
              </div>


              <div class="layui-form-item">
                  <label class="layui-form-label">通道ID</label>
                  <div class="layui-input-inline">
                      <input type="text" id="passageId" disabled="disabled" class="layui-input">
                  </div>
              </div>
              <div class="layui-form-item">
                  <label class="layui-form-label">操作人ID</label>
                  <div class="layui-input-inline">
                      <input type="text" id="operatorUserId" disabled="disabled" class="layui-input">
                  </div>
                  <label class="layui-form-label">操作人姓名</label>
                  <div class="layui-input-inline">
                      <input type="text" id="operatorName" disabled="disabled" class="layui-input">
                  </div>
              </div>
              <div class="layui-form-item">
                  <label class="layui-form-label">抢单人ID</label>
                  <div class="layui-input-inline">
                      <input type="text" id="snatchUserId" disabled="disabled" class="layui-input">
                  </div>
                  <label class="layui-form-label">抢单人姓名</label>
                  <div class="layui-input-inline">
                      <input type="text" id="snatchName" disabled="disabled" class="layui-input">
                  </div>
              </div>
              <div class="layui-form-item">
                  <label class="layui-form-label">抢单时间</label>
                  <div class="layui-input-inline">
                      <input type="text" id="snatchTime" disabled="disabled" class="layui-input">
                  </div>
                  <label class="layui-form-label">弃单时间</label>
                  <div class="layui-input-inline">
                      <input type="text" id="giveUpTime" disabled="disabled" class="layui-input">
                  </div>
              </div>
              <div class="layui-form-item">
                  <label class="layui-form-label">创建时间</label>
                  <div class="layui-input-inline">
                      <input type="text" id="createTime" disabled="disabled" class="layui-input">
                  </div>
                  <label class="layui-form-label">更新时间</label>
                  <div class="layui-input-inline">
                      <input type="text" id="updateTime" disabled="disabled" class="layui-input">
                  </div>
              </div>
          </form>
      </div>
    </div>
  </div>
</div>
<script>
    layui.use(['admin', 'form'],function(){
        var form = layui.form
        ,$ = layui.$
        ,admin = layui.admin
        ,element = layui.element
        ,view = layui.view
        ,layer = layui.layer ;
        // 导航
        element.render('breadcrumb', 'breadcrumb');
        var agentpayOrderId = view.getOpenParams('agentpayOrderId');
        admin.req({
            type: 'get',
            url: layui.setter.baseUrl + '/agentpay/get',
            data: {
                agentpayOrderId : agentpayOrderId
            },
            error: function(err){
                layer.alert(JSON.stringify(err.field), {
                    title: '错误提示'
                })
            },
            success: function(res){
                if(res.code == 0){
                    $('#agentpayOrderId').val(res.data.agentpayOrderId);
                    $('#mchOrderNo').val(res.data.mchOrderNo);
                    $('#batchNo').val(res.data.batchNo);
                    $('#mchId').val(res.data.mchId);
                    $('#amount').val(res.data.amount/100);
                    $('#fee').val(res.data.fee/100);
                    $('#remitAmount').val(res.data.remitAmount/100);
                    $('#subAmount').val(res.data.subAmount/100);
                    $('#passageId').val(res.data.passageId);
                    $('#accountAttr').val(res.data.accountAttr == 0 ? "对私" : res.data.accountAttr == 1 ? "对公" : "");
                    $('#accountName').val(res.data.accountName);
                    $('#accountNo').val(res.data.accountNo);
                    $('#transOrderId').val(res.data.transOrderId);
                    $('#status').val(res.data.status ==0?"待处理":res.data.status ==1?"处理中":res.data.status ==2?"成功":res.data.status ==4?"待审核":res.data.status ==3?"失败 ("+ (res.data.transMsg == null ? "" : res.data.transMsg)  + ")" :"未知状态");
                    $('#province').val(res.data.province);
                    $('#city').val(res.data.city);
                    $('#bankName').val(res.data.bankName);
                    $('#bankNetName').val(res.data.bankNetName);
                    $('#bankNumber').val(res.data.bankNumber);
                    $('#bankCode').val(res.data.bankCode);
                    $('#clientIp').val(res.data.clientIp);
                    $('#device').val(res.data.device);
                    $('#notifyUrl').val(res.data.notifyUrl);
                    $('#remark').val(res.data.remark);
                    $('#mchConfirmReqUrl').val(res.data.mchConfirmReqUrl);
                    $('#mchConfirmResp').val(res.data.mchConfirmResp);

                    $('#subAmountFrom').val(res.data.subAmountFrom ==1? "收款账户" : res.data.subAmountFrom ==2? "代付余额账户" : "未知");
                    if(res.data.createTime != "" && res.data.createTime != null) {
                        $('#createTime').val(layui.util.toDateString(res.data.createTime));
                    }
                    if(res.data.updateTime != "" && res.data.updateTime != null) {
                        $('#updateTime').val(layui.util.toDateString(res.data.updateTime));
                    }


                    $("#operatorUserId").val(res.data.operatorUserId);
                    $("#operatorName").val(res.data.operatorName);
                    $("#snatchUserId").val(res.data.snatchUserId);
                    $("#snatchName").val(res.data.snatchName);
                    $("#snatchTime").val(res.data.snatchTime ? layui.util.toDateString(res.data.snatchTime) : "");
                    $("#giveUpTime").val(res.data.giveUpTime ? layui.util.toDateString(res.data.giveUpTime) : "");

                    form.render();
                }
            }
        })
    })
</script>